package br.com.estevam.sisfin.daos;

import org.apache.tapestry5.hibernate.HibernateSessionManager;
import org.apache.tapestry5.services.ApplicationStateManager;

import br.com.estevam.sisfin.daos.interfaces.SexoDAO;
import br.com.estevam.sisfin.entities.Sexo;

public class SexoDAOImpl extends AbstractDAOImpl implements SexoDAO {

	public SexoDAOImpl(HibernateSessionManager hsm,	ApplicationStateManager asm) {
		super(hsm, asm, Sexo.class);
		executarCriarSexo();
	}

	void executarCriarSexo(){
		if(rowCountAll() == 0){
			add(new Sexo("Masculino"));
			add(new Sexo("Feminino"));
			
			commit();
		}
	}

}
